<?php
class MySQL extends mysqli {
	public function __construct($host, $user, $password, $database, $port,$charset='utf8'){
		@parent::__construct($host, $user, $password, $database, $port);
		if($this->connect_errno){
			exit($this->connect_error);
		}
		$this->set_charset($charset);
	}
	public function execute($query){
		$this->result=$this->query($query);
		if($this->errno){
			exit($this->error);
		}
	}
}
